package com.ruoyi.pyo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pyo.mapper.PetYeahHospitalMapper;
import com.ruoyi.pyo.domain.PetYeahHospital;
import com.ruoyi.pyo.service.IPetYeahHospitalService;

/**
 * 医院Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class PetYeahHospitalServiceImpl implements IPetYeahHospitalService 
{
    @Autowired
    private PetYeahHospitalMapper petYeahHospitalMapper;

    /**
     * 查询医院
     * 
     * @param id 医院主键
     * @return 医院
     */
    @Override
    public PetYeahHospital selectPetYeahHospitalById(Long id)
    {
        return petYeahHospitalMapper.selectPetYeahHospitalById(id);
    }

    /**
     * 查询医院列表
     * 
     * @param petYeahHospital 医院
     * @return 医院
     */
    @Override
    public List<PetYeahHospital> selectPetYeahHospitalList(PetYeahHospital petYeahHospital)
    {
        return petYeahHospitalMapper.selectPetYeahHospitalList(petYeahHospital);
    }

    /**
     * 新增医院
     * 
     * @param petYeahHospital 医院
     * @return 结果
     */
    @Override
    public int insertPetYeahHospital(PetYeahHospital petYeahHospital)
    {
        petYeahHospital.setCreateTime(DateUtils.getNowDate());
        return petYeahHospitalMapper.insertPetYeahHospital(petYeahHospital);
    }

    /**
     * 修改医院
     * 
     * @param petYeahHospital 医院
     * @return 结果
     */
    @Override
    public int updatePetYeahHospital(PetYeahHospital petYeahHospital)
    {
        petYeahHospital.setUpdateTime(DateUtils.getNowDate());
        return petYeahHospitalMapper.updatePetYeahHospital(petYeahHospital);
    }

    /**
     * 批量删除医院
     * 
     * @param ids 需要删除的医院主键
     * @return 结果
     */
    @Override
    public int deletePetYeahHospitalByIds(Long[] ids)
    {
        return petYeahHospitalMapper.deletePetYeahHospitalByIds(ids);
    }

    /**
     * 删除医院信息
     * 
     * @param id 医院主键
     * @return 结果
     */
    @Override
    public int deletePetYeahHospitalById(Long id)
    {
        return petYeahHospitalMapper.deletePetYeahHospitalById(id);
    }
}
